package com.system.service;


import com.common.utils.AjaxResult;
import com.system.entity.SysUserRoleEntity;
import com.system.entity.utilentity.RoleVo;

import java.util.List;
import java.util.Set;

/**
 * 用户和角色关联表
 *
 * @author yangzhan
 * @email *****@mail.com
 * @date 2022-04-11 20:41:31
 */
public interface ISysUserRoleService {


    /**
     * 数据添加
     *
     * @param sysUserRoleEntity
     */

    AjaxResult sysUserRoleAdd(SysUserRoleEntity sysUserRoleEntity);

    /**
     * 删除与批量删除
     *
     * @param ids
     */
    AjaxResult sysUserRoleDel(List<Integer> ids);

    /**
     * 更新
     *
     * @param sysUserRoleEntity
     */
    AjaxResult sysUserRoleUpById(SysUserRoleEntity sysUserRoleEntity);

    /**
     * 查询单条数据
     */
    SysUserRoleEntity sysUserRoleGetById(String id);


    /**
     * 查询数据库
     *
     * @return
     */
    AjaxResult sysUserRoleSelectListByPage(SysUserRoleEntity sysUserRoleEntity);

    /**
     * 查询数据库
     *
     * @return
     */
    AjaxResult sysUserRoleSelectListByPageTo(SysUserRoleEntity sysUserRoleEntity);

    /**
     * 添加分配的角色
     *
     * @param roleVo
     * @return
     */
    AjaxResult addRole(RoleVo roleVo);

    /**
     * 查询用户的角色id
     *
     * @param userId
     * @return
     */
    Long sysUserRoleGetUserById(Long userId);

    /**
     * 获取角色权限字符
     *
     * @param userId
     * @return
     */
    Set<String> selectRoleKeys(Long userId);
}

